#include <AVUITransform.h>

namespace AVUI {

/// <summary>Translates (moves) an object in the 2-D x-y coordinate system. </summary>
class TranslateTransform : public Transform
{
public:
    DECLARE_ELEMENT(TranslateTransform, Transform);

#pragma region Public Methods

    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.TranslateTransform" /> class. </summary>
    TranslateTransform() { };

    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.TranslateTransform" /> class and specifies the displacements in the direction of the x- and y- axes. </summary>
    /// <param name="offsetX">The displacement in the direction of the x-axis.</param>
    /// <param name="offsetY">The displacement in the direction of the y-axis.</param>
    TranslateTransform(float offsetX, float offsetY);

    /// <summary>Creates a modifiable copy of this <see cref="T:System.Windows.Media.TranslateTransform" /> by making deep copies of its values. </summary>
    /// <returns>A modifiable deep copy of the current object. The <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the cloned object returns false even if the <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the source is true.</returns>
    TRefCountedPtr<TranslateTransform> Clone() { return (TranslateTransform*) Transform::Clone().get_Ptr(); }

    /// <summary>Creates a modifiable copy of this <see cref="T:System.Windows.Media.TranslateTransform" /> object by making deep copies of its values. This method does not copy resource references, data bindings, and animations, although it does copy their current values. </summary>
    /// <returns>A modifiable deep copy of the current object. The <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the cloned object is false even if the <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the source is true.</returns>
    TRefCountedPtr<TranslateTransform> CloneCurrentValue() { return (TranslateTransform*) Transform::CloneCurrentValue().get_Ptr(); }

#pragma endregion Public Methods

#pragma region Public Properties
    /// <summary>Gets a <see cref="T:System.Windows.Media.Matrix" /> representation of this <see cref="T:System.Windows.Media.TranslateTransform" />.</summary>
    /// <returns>A matrix that represents this <see cref="T:System.Windows.Media.TranslateTransform" />.</returns>
    virtual Matrix get_Value() AVUI_OVERRIDE;

    /// <summary>Gets or sets the distance to translate along the x-axis. This is a dependency property. </summary>
    /// <returns>The distance to translate (move) an object along the x-axis. The default value is 0.</returns>
    float get_X() { return AVUI::UnboxValue<float>(GetValue(get_XProperty())); }
    void set_X(float value) { SetValue(get_XProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(X);

    /// <summary>Gets or sets the distance to translate (move) an object along the y-axis. This is a dependency property. </summary>
    /// <returns>The distance to translate (move) an object along the y-axis. The default value is 0.</returns>
    float get_Y() { return AVUI::UnboxValue<float>(GetValue(get_YProperty())); }
    void set_Y(float value) { SetValue(get_YProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(Y);

#pragma endregion Public Properties

protected:

#pragma region Protected Methods

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<TranslateTransform>().get_Ptr(); }

#pragma endregion Protected Methods

public:

#pragma region Internal Methods

    virtual void MultiplyValueByMatrix(Matrix* pResult, const Matrix& matrixToMultiplyBy) AVUI_OVERRIDE;
    virtual void TransformRect(Rect* pRect) AVUI_OVERRIDE;

#pragma endregion Internal Methods

#pragma region Internal Properties

    virtual bool get_IsIdentity() AVUI_OVERRIDE;

#pragma endregion Internal Properties

private:

#pragma region Private Methods

    static void StaticConstructor();

#pragma endregion Private Methods

};


typedef TRefCountedPtr<TranslateTransform> TranslateTransformPtr;


}; // namespace AVUI
